// Copyright 2021-2023 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// LINT: ALLOW_GROUPS

// @generated by protoc-gen-es v1.4.1 with parameter "ts_nocheck=false,target=ts"
// @generated from file google/protobuf/test_messages_proto2.proto (package protobuf_test_messages.proto2, syntax proto2)
/* eslint-disable */

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "npm:@bufbuild/protobuf";
import { Message, proto2, protoInt64 } from "npm:@bufbuild/protobuf";

/**
 * @generated from enum protobuf_test_messages.proto2.ForeignEnumProto2
 */
export enum ForeignEnumProto2 {
  /**
   * @generated from enum value: FOREIGN_FOO = 0;
   */
  FOREIGN_FOO = 0,

  /**
   * @generated from enum value: FOREIGN_BAR = 1;
   */
  FOREIGN_BAR = 1,

  /**
   * @generated from enum value: FOREIGN_BAZ = 2;
   */
  FOREIGN_BAZ = 2,
}
// Retrieve enum metadata with: proto2.getEnumType(ForeignEnumProto2)
proto2.util.setEnumType(ForeignEnumProto2, "protobuf_test_messages.proto2.ForeignEnumProto2", [
  { no: 0, name: "FOREIGN_FOO" },
  { no: 1, name: "FOREIGN_BAR" },
  { no: 2, name: "FOREIGN_BAZ" },
]);

/**
 * This proto includes every type of field in both singular and repeated
 * forms.
 *
 * Also, crucially, all messages and enums in this file are eventually
 * submessages of this message.  So for example, a fuzz test of TestAllTypes
 * could trigger bugs that occur in any message type in this file.  We verify
 * this stays true in a unit test.
 *
 * @generated from message protobuf_test_messages.proto2.TestAllTypesProto2
 */
export class TestAllTypesProto2 extends Message<TestAllTypesProto2> {
  /**
   * Singular
   *
   * @generated from field: optional int32 optional_int32 = 1;
   */
  optionalInt32?: number;

  /**
   * @generated from field: optional int64 optional_int64 = 2;
   */
  optionalInt64?: bigint;

  /**
   * @generated from field: optional uint32 optional_uint32 = 3;
   */
  optionalUint32?: number;

  /**
   * @generated from field: optional uint64 optional_uint64 = 4;
   */
  optionalUint64?: bigint;

  /**
   * @generated from field: optional sint32 optional_sint32 = 5;
   */
  optionalSint32?: number;

  /**
   * @generated from field: optional sint64 optional_sint64 = 6;
   */
  optionalSint64?: bigint;

  /**
   * @generated from field: optional fixed32 optional_fixed32 = 7;
   */
  optionalFixed32?: number;

  /**
   * @generated from field: optional fixed64 optional_fixed64 = 8;
   */
  optionalFixed64?: bigint;

  /**
   * @generated from field: optional sfixed32 optional_sfixed32 = 9;
   */
  optionalSfixed32?: number;

  /**
   * @generated from field: optional sfixed64 optional_sfixed64 = 10;
   */
  optionalSfixed64?: bigint;

  /**
   * @generated from field: optional float optional_float = 11;
   */
  optionalFloat?: number;

  /**
   * @generated from field: optional double optional_double = 12;
   */
  optionalDouble?: number;

  /**
   * @generated from field: optional bool optional_bool = 13;
   */
  optionalBool?: boolean;

  /**
   * @generated from field: optional string optional_string = 14;
   */
  optionalString?: string;

  /**
   * @generated from field: optional bytes optional_bytes = 15;
   */
  optionalBytes?: Uint8Array;

  /**
   * @generated from field: optional protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage optional_nested_message = 18;
   */
  optionalNestedMessage?: TestAllTypesProto2_NestedMessage;

  /**
   * @generated from field: optional protobuf_test_messages.proto2.ForeignMessageProto2 optional_foreign_message = 19;
   */
  optionalForeignMessage?: ForeignMessageProto2;

  /**
   * @generated from field: optional protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum optional_nested_enum = 21;
   */
  optionalNestedEnum?: TestAllTypesProto2_NestedEnum;

  /**
   * @generated from field: optional protobuf_test_messages.proto2.ForeignEnumProto2 optional_foreign_enum = 22;
   */
  optionalForeignEnum?: ForeignEnumProto2;

  /**
   * @generated from field: optional string optional_string_piece = 24;
   */
  optionalStringPiece?: string;

  /**
   * @generated from field: optional string optional_cord = 25;
   */
  optionalCord?: string;

  /**
   * @generated from field: optional protobuf_test_messages.proto2.TestAllTypesProto2 recursive_message = 27;
   */
  recursiveMessage?: TestAllTypesProto2;

  /**
   * Repeated
   *
   * @generated from field: repeated int32 repeated_int32 = 31;
   */
  repeatedInt32: number[] = [];

  /**
   * @generated from field: repeated int64 repeated_int64 = 32;
   */
  repeatedInt64: bigint[] = [];

  /**
   * @generated from field: repeated uint32 repeated_uint32 = 33;
   */
  repeatedUint32: number[] = [];

  /**
   * @generated from field: repeated uint64 repeated_uint64 = 34;
   */
  repeatedUint64: bigint[] = [];

  /**
   * @generated from field: repeated sint32 repeated_sint32 = 35;
   */
  repeatedSint32: number[] = [];

  /**
   * @generated from field: repeated sint64 repeated_sint64 = 36;
   */
  repeatedSint64: bigint[] = [];

  /**
   * @generated from field: repeated fixed32 repeated_fixed32 = 37;
   */
  repeatedFixed32: number[] = [];

  /**
   * @generated from field: repeated fixed64 repeated_fixed64 = 38;
   */
  repeatedFixed64: bigint[] = [];

  /**
   * @generated from field: repeated sfixed32 repeated_sfixed32 = 39;
   */
  repeatedSfixed32: number[] = [];

  /**
   * @generated from field: repeated sfixed64 repeated_sfixed64 = 40;
   */
  repeatedSfixed64: bigint[] = [];

  /**
   * @generated from field: repeated float repeated_float = 41;
   */
  repeatedFloat: number[] = [];

  /**
   * @generated from field: repeated double repeated_double = 42;
   */
  repeatedDouble: number[] = [];

  /**
   * @generated from field: repeated bool repeated_bool = 43;
   */
  repeatedBool: boolean[] = [];

  /**
   * @generated from field: repeated string repeated_string = 44;
   */
  repeatedString: string[] = [];

  /**
   * @generated from field: repeated bytes repeated_bytes = 45;
   */
  repeatedBytes: Uint8Array[] = [];

  /**
   * @generated from field: repeated protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage repeated_nested_message = 48;
   */
  repeatedNestedMessage: TestAllTypesProto2_NestedMessage[] = [];

  /**
   * @generated from field: repeated protobuf_test_messages.proto2.ForeignMessageProto2 repeated_foreign_message = 49;
   */
  repeatedForeignMessage: ForeignMessageProto2[] = [];

  /**
   * @generated from field: repeated protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum repeated_nested_enum = 51;
   */
  repeatedNestedEnum: TestAllTypesProto2_NestedEnum[] = [];

  /**
   * @generated from field: repeated protobuf_test_messages.proto2.ForeignEnumProto2 repeated_foreign_enum = 52;
   */
  repeatedForeignEnum: ForeignEnumProto2[] = [];

  /**
   * @generated from field: repeated string repeated_string_piece = 54;
   */
  repeatedStringPiece: string[] = [];

  /**
   * @generated from field: repeated string repeated_cord = 55;
   */
  repeatedCord: string[] = [];

  /**
   * Packed
   *
   * @generated from field: repeated int32 packed_int32 = 75 [packed = true];
   */
  packedInt32: number[] = [];

  /**
   * @generated from field: repeated int64 packed_int64 = 76 [packed = true];
   */
  packedInt64: bigint[] = [];

  /**
   * @generated from field: repeated uint32 packed_uint32 = 77 [packed = true];
   */
  packedUint32: number[] = [];

  /**
   * @generated from field: repeated uint64 packed_uint64 = 78 [packed = true];
   */
  packedUint64: bigint[] = [];

  /**
   * @generated from field: repeated sint32 packed_sint32 = 79 [packed = true];
   */
  packedSint32: number[] = [];

  /**
   * @generated from field: repeated sint64 packed_sint64 = 80 [packed = true];
   */
  packedSint64: bigint[] = [];

  /**
   * @generated from field: repeated fixed32 packed_fixed32 = 81 [packed = true];
   */
  packedFixed32: number[] = [];

  /**
   * @generated from field: repeated fixed64 packed_fixed64 = 82 [packed = true];
   */
  packedFixed64: bigint[] = [];

  /**
   * @generated from field: repeated sfixed32 packed_sfixed32 = 83 [packed = true];
   */
  packedSfixed32: number[] = [];

  /**
   * @generated from field: repeated sfixed64 packed_sfixed64 = 84 [packed = true];
   */
  packedSfixed64: bigint[] = [];

  /**
   * @generated from field: repeated float packed_float = 85 [packed = true];
   */
  packedFloat: number[] = [];

  /**
   * @generated from field: repeated double packed_double = 86 [packed = true];
   */
  packedDouble: number[] = [];

  /**
   * @generated from field: repeated bool packed_bool = 87 [packed = true];
   */
  packedBool: boolean[] = [];

  /**
   * @generated from field: repeated protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum packed_nested_enum = 88 [packed = true];
   */
  packedNestedEnum: TestAllTypesProto2_NestedEnum[] = [];

  /**
   * Unpacked
   *
   * @generated from field: repeated int32 unpacked_int32 = 89 [packed = false];
   */
  unpackedInt32: number[] = [];

  /**
   * @generated from field: repeated int64 unpacked_int64 = 90 [packed = false];
   */
  unpackedInt64: bigint[] = [];

  /**
   * @generated from field: repeated uint32 unpacked_uint32 = 91 [packed = false];
   */
  unpackedUint32: number[] = [];

  /**
   * @generated from field: repeated uint64 unpacked_uint64 = 92 [packed = false];
   */
  unpackedUint64: bigint[] = [];

  /**
   * @generated from field: repeated sint32 unpacked_sint32 = 93 [packed = false];
   */
  unpackedSint32: number[] = [];

  /**
   * @generated from field: repeated sint64 unpacked_sint64 = 94 [packed = false];
   */
  unpackedSint64: bigint[] = [];

  /**
   * @generated from field: repeated fixed32 unpacked_fixed32 = 95 [packed = false];
   */
  unpackedFixed32: number[] = [];

  /**
   * @generated from field: repeated fixed64 unpacked_fixed64 = 96 [packed = false];
   */
  unpackedFixed64: bigint[] = [];

  /**
   * @generated from field: repeated sfixed32 unpacked_sfixed32 = 97 [packed = false];
   */
  unpackedSfixed32: number[] = [];

  /**
   * @generated from field: repeated sfixed64 unpacked_sfixed64 = 98 [packed = false];
   */
  unpackedSfixed64: bigint[] = [];

  /**
   * @generated from field: repeated float unpacked_float = 99 [packed = false];
   */
  unpackedFloat: number[] = [];

  /**
   * @generated from field: repeated double unpacked_double = 100 [packed = false];
   */
  unpackedDouble: number[] = [];

  /**
   * @generated from field: repeated bool unpacked_bool = 101 [packed = false];
   */
  unpackedBool: boolean[] = [];

  /**
   * @generated from field: repeated protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum unpacked_nested_enum = 102 [packed = false];
   */
  unpackedNestedEnum: TestAllTypesProto2_NestedEnum[] = [];

  /**
   * Map
   *
   * @generated from field: map<int32, int32> map_int32_int32 = 56;
   */
  mapInt32Int32: { [key: number]: number } = {};

  /**
   * @generated from field: map<int64, int64> map_int64_int64 = 57;
   */
  mapInt64Int64: { [key: string]: bigint } = {};

  /**
   * @generated from field: map<uint32, uint32> map_uint32_uint32 = 58;
   */
  mapUint32Uint32: { [key: number]: number } = {};

  /**
   * @generated from field: map<uint64, uint64> map_uint64_uint64 = 59;
   */
  mapUint64Uint64: { [key: string]: bigint } = {};

  /**
   * @generated from field: map<sint32, sint32> map_sint32_sint32 = 60;
   */
  mapSint32Sint32: { [key: number]: number } = {};

  /**
   * @generated from field: map<sint64, sint64> map_sint64_sint64 = 61;
   */
  mapSint64Sint64: { [key: string]: bigint } = {};

  /**
   * @generated from field: map<fixed32, fixed32> map_fixed32_fixed32 = 62;
   */
  mapFixed32Fixed32: { [key: number]: number } = {};

  /**
   * @generated from field: map<fixed64, fixed64> map_fixed64_fixed64 = 63;
   */
  mapFixed64Fixed64: { [key: string]: bigint } = {};

  /**
   * @generated from field: map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 64;
   */
  mapSfixed32Sfixed32: { [key: number]: number } = {};

  /**
   * @generated from field: map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 65;
   */
  mapSfixed64Sfixed64: { [key: string]: bigint } = {};

  /**
   * @generated from field: map<int32, float> map_int32_float = 66;
   */
  mapInt32Float: { [key: number]: number } = {};

  /**
   * @generated from field: map<int32, double> map_int32_double = 67;
   */
  mapInt32Double: { [key: number]: number } = {};

  /**
   * @generated from field: map<bool, bool> map_bool_bool = 68;
   */
  mapBoolBool: { [key: string]: boolean } = {};

  /**
   * @generated from field: map<string, string> map_string_string = 69;
   */
  mapStringString: { [key: string]: string } = {};

  /**
   * @generated from field: map<string, bytes> map_string_bytes = 70;
   */
  mapStringBytes: { [key: string]: Uint8Array } = {};

  /**
   * @generated from field: map<string, protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage> map_string_nested_message = 71;
   */
  mapStringNestedMessage: { [key: string]: TestAllTypesProto2_NestedMessage } = {};

  /**
   * @generated from field: map<string, protobuf_test_messages.proto2.ForeignMessageProto2> map_string_foreign_message = 72;
   */
  mapStringForeignMessage: { [key: string]: ForeignMessageProto2 } = {};

  /**
   * @generated from field: map<string, protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum> map_string_nested_enum = 73;
   */
  mapStringNestedEnum: { [key: string]: TestAllTypesProto2_NestedEnum } = {};

  /**
   * @generated from field: map<string, protobuf_test_messages.proto2.ForeignEnumProto2> map_string_foreign_enum = 74;
   */
  mapStringForeignEnum: { [key: string]: ForeignEnumProto2 } = {};

  /**
   * @generated from oneof protobuf_test_messages.proto2.TestAllTypesProto2.oneof_field
   */
  oneofField: {
    /**
     * @generated from field: uint32 oneof_uint32 = 111;
     */
    value: number;
    case: "oneofUint32";
  } | {
    /**
     * @generated from field: protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage oneof_nested_message = 112;
     */
    value: TestAllTypesProto2_NestedMessage;
    case: "oneofNestedMessage";
  } | {
    /**
     * @generated from field: string oneof_string = 113;
     */
    value: string;
    case: "oneofString";
  } | {
    /**
     * @generated from field: bytes oneof_bytes = 114;
     */
    value: Uint8Array;
    case: "oneofBytes";
  } | {
    /**
     * @generated from field: bool oneof_bool = 115;
     */
    value: boolean;
    case: "oneofBool";
  } | {
    /**
     * @generated from field: uint64 oneof_uint64 = 116;
     */
    value: bigint;
    case: "oneofUint64";
  } | {
    /**
     * @generated from field: float oneof_float = 117;
     */
    value: number;
    case: "oneofFloat";
  } | {
    /**
     * @generated from field: double oneof_double = 118;
     */
    value: number;
    case: "oneofDouble";
  } | {
    /**
     * @generated from field: protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum oneof_enum = 119;
     */
    value: TestAllTypesProto2_NestedEnum;
    case: "oneofEnum";
  } | { case: undefined; value?: undefined } = { case: undefined };

  /**
   * @generated from field: optional protobuf_test_messages.proto2.TestAllTypesProto2.Data data = 201;
   */
  data?: TestAllTypesProto2_Data;

  /**
   * default values
   *
   * @generated from field: optional int32 default_int32 = 241 [default = -123456789];
   */
  defaultInt32?: number;

  /**
   * @generated from field: optional int64 default_int64 = 242 [default = -9123456789123456789];
   */
  defaultInt64?: bigint;

  /**
   * @generated from field: optional uint32 default_uint32 = 243 [default = 2123456789];
   */
  defaultUint32?: number;

  /**
   * @generated from field: optional uint64 default_uint64 = 244 [default = 10123456789123456789];
   */
  defaultUint64?: bigint;

  /**
   * @generated from field: optional sint32 default_sint32 = 245 [default = -123456789];
   */
  defaultSint32?: number;

  /**
   * @generated from field: optional sint64 default_sint64 = 246 [default = -9123456789123456789];
   */
  defaultSint64?: bigint;

  /**
   * @generated from field: optional fixed32 default_fixed32 = 247 [default = 2123456789];
   */
  defaultFixed32?: number;

  /**
   * @generated from field: optional fixed64 default_fixed64 = 248 [default = 10123456789123456789];
   */
  defaultFixed64?: bigint;

  /**
   * @generated from field: optional sfixed32 default_sfixed32 = 249 [default = -123456789];
   */
  defaultSfixed32?: number;

  /**
   * @generated from field: optional sfixed64 default_sfixed64 = 250 [default = -9123456789123456789];
   */
  defaultSfixed64?: bigint;

  /**
   * @generated from field: optional float default_float = 251 [default = 9e+09];
   */
  defaultFloat?: number;

  /**
   * @generated from field: optional double default_double = 252 [default = 7e+22];
   */
  defaultDouble?: number;

  /**
   * @generated from field: optional bool default_bool = 253 [default = true];
   */
  defaultBool?: boolean;

  /**
   * @generated from field: optional string default_string = 254 [default = "Rosebud"];
   */
  defaultString?: string;

  /**
   * @generated from field: optional bytes default_bytes = 255 [default = "joshua"];
   */
  defaultBytes?: Uint8Array;

  /**
   * Test field-name-to-JSON-name convention.
   * (protobuf says names can be any valid C/C++ identifier.)
   *
   * @generated from field: optional int32 fieldname1 = 401;
   */
  fieldname1?: number;

  /**
   * @generated from field: optional int32 field_name2 = 402;
   */
  fieldName2?: number;

  /**
   * @generated from field: optional int32 _field_name3 = 403;
   */
  FieldName3?: number;

  /**
   * @generated from field: optional int32 field__name4_ = 404;
   */
  fieldName4?: number;

  /**
   * @generated from field: optional int32 field0name5 = 405;
   */
  field0name5?: number;

  /**
   * @generated from field: optional int32 field_0_name6 = 406;
   */
  field0Name6?: number;

  /**
   * @generated from field: optional int32 fieldName7 = 407;
   */
  fieldName7?: number;

  /**
   * @generated from field: optional int32 FieldName8 = 408;
   */
  FieldName8?: number;

  /**
   * @generated from field: optional int32 field_Name9 = 409;
   */
  fieldName9?: number;

  /**
   * @generated from field: optional int32 Field_Name10 = 410;
   */
  FieldName10?: number;

  /**
   * @generated from field: optional int32 FIELD_NAME11 = 411;
   */
  FIELDNAME11?: number;

  /**
   * @generated from field: optional int32 FIELD_name12 = 412;
   */
  FIELDName12?: number;

  /**
   * @generated from field: optional int32 __field_name13 = 413;
   */
  FieldName13?: number;

  /**
   * @generated from field: optional int32 __Field_name14 = 414;
   */
  FieldName14?: number;

  /**
   * @generated from field: optional int32 field__name15 = 415;
   */
  fieldName15?: number;

  /**
   * @generated from field: optional int32 field__Name16 = 416;
   */
  fieldName16?: number;

  /**
   * @generated from field: optional int32 field_name17__ = 417;
   */
  fieldName17?: number;

  /**
   * @generated from field: optional int32 Field_name18__ = 418;
   */
  FieldName18?: number;

  constructor(data?: PartialMessage<TestAllTypesProto2>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.TestAllTypesProto2";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 1, name: "optional_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 2, name: "optional_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
    { no: 3, name: "optional_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true },
    { no: 4, name: "optional_uint64", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true },
    { no: 5, name: "optional_sint32", kind: "scalar", T: 17 /* ScalarType.SINT32 */, opt: true },
    { no: 6, name: "optional_sint64", kind: "scalar", T: 18 /* ScalarType.SINT64 */, opt: true },
    { no: 7, name: "optional_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, opt: true },
    { no: 8, name: "optional_fixed64", kind: "scalar", T: 6 /* ScalarType.FIXED64 */, opt: true },
    { no: 9, name: "optional_sfixed32", kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, opt: true },
    { no: 10, name: "optional_sfixed64", kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, opt: true },
    { no: 11, name: "optional_float", kind: "scalar", T: 2 /* ScalarType.FLOAT */, opt: true },
    { no: 12, name: "optional_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, opt: true },
    { no: 13, name: "optional_bool", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
    { no: 14, name: "optional_string", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
    { no: 15, name: "optional_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true },
    { no: 18, name: "optional_nested_message", kind: "message", T: TestAllTypesProto2_NestedMessage, opt: true },
    { no: 19, name: "optional_foreign_message", kind: "message", T: ForeignMessageProto2, opt: true },
    { no: 21, name: "optional_nested_enum", kind: "enum", T: proto2.getEnumType(TestAllTypesProto2_NestedEnum), opt: true },
    { no: 22, name: "optional_foreign_enum", kind: "enum", T: proto2.getEnumType(ForeignEnumProto2), opt: true },
    { no: 24, name: "optional_string_piece", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
    { no: 25, name: "optional_cord", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
    { no: 27, name: "recursive_message", kind: "message", T: TestAllTypesProto2, opt: true },
    { no: 31, name: "repeated_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true },
    { no: 32, name: "repeated_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */, repeated: true },
    { no: 33, name: "repeated_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, repeated: true },
    { no: 34, name: "repeated_uint64", kind: "scalar", T: 4 /* ScalarType.UINT64 */, repeated: true },
    { no: 35, name: "repeated_sint32", kind: "scalar", T: 17 /* ScalarType.SINT32 */, repeated: true },
    { no: 36, name: "repeated_sint64", kind: "scalar", T: 18 /* ScalarType.SINT64 */, repeated: true },
    { no: 37, name: "repeated_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, repeated: true },
    { no: 38, name: "repeated_fixed64", kind: "scalar", T: 6 /* ScalarType.FIXED64 */, repeated: true },
    { no: 39, name: "repeated_sfixed32", kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, repeated: true },
    { no: 40, name: "repeated_sfixed64", kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, repeated: true },
    { no: 41, name: "repeated_float", kind: "scalar", T: 2 /* ScalarType.FLOAT */, repeated: true },
    { no: 42, name: "repeated_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, repeated: true },
    { no: 43, name: "repeated_bool", kind: "scalar", T: 8 /* ScalarType.BOOL */, repeated: true },
    { no: 44, name: "repeated_string", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
    { no: 45, name: "repeated_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, repeated: true },
    { no: 48, name: "repeated_nested_message", kind: "message", T: TestAllTypesProto2_NestedMessage, repeated: true },
    { no: 49, name: "repeated_foreign_message", kind: "message", T: ForeignMessageProto2, repeated: true },
    { no: 51, name: "repeated_nested_enum", kind: "enum", T: proto2.getEnumType(TestAllTypesProto2_NestedEnum), repeated: true },
    { no: 52, name: "repeated_foreign_enum", kind: "enum", T: proto2.getEnumType(ForeignEnumProto2), repeated: true },
    { no: 54, name: "repeated_string_piece", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
    { no: 55, name: "repeated_cord", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
    { no: 75, name: "packed_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true, packed: true },
    { no: 76, name: "packed_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */, repeated: true, packed: true },
    { no: 77, name: "packed_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, repeated: true, packed: true },
    { no: 78, name: "packed_uint64", kind: "scalar", T: 4 /* ScalarType.UINT64 */, repeated: true, packed: true },
    { no: 79, name: "packed_sint32", kind: "scalar", T: 17 /* ScalarType.SINT32 */, repeated: true, packed: true },
    { no: 80, name: "packed_sint64", kind: "scalar", T: 18 /* ScalarType.SINT64 */, repeated: true, packed: true },
    { no: 81, name: "packed_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, repeated: true, packed: true },
    { no: 82, name: "packed_fixed64", kind: "scalar", T: 6 /* ScalarType.FIXED64 */, repeated: true, packed: true },
    { no: 83, name: "packed_sfixed32", kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, repeated: true, packed: true },
    { no: 84, name: "packed_sfixed64", kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, repeated: true, packed: true },
    { no: 85, name: "packed_float", kind: "scalar", T: 2 /* ScalarType.FLOAT */, repeated: true, packed: true },
    { no: 86, name: "packed_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, repeated: true, packed: true },
    { no: 87, name: "packed_bool", kind: "scalar", T: 8 /* ScalarType.BOOL */, repeated: true, packed: true },
    { no: 88, name: "packed_nested_enum", kind: "enum", T: proto2.getEnumType(TestAllTypesProto2_NestedEnum), repeated: true, packed: true },
    { no: 89, name: "unpacked_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true },
    { no: 90, name: "unpacked_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */, repeated: true },
    { no: 91, name: "unpacked_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, repeated: true },
    { no: 92, name: "unpacked_uint64", kind: "scalar", T: 4 /* ScalarType.UINT64 */, repeated: true },
    { no: 93, name: "unpacked_sint32", kind: "scalar", T: 17 /* ScalarType.SINT32 */, repeated: true },
    { no: 94, name: "unpacked_sint64", kind: "scalar", T: 18 /* ScalarType.SINT64 */, repeated: true },
    { no: 95, name: "unpacked_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, repeated: true },
    { no: 96, name: "unpacked_fixed64", kind: "scalar", T: 6 /* ScalarType.FIXED64 */, repeated: true },
    { no: 97, name: "unpacked_sfixed32", kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, repeated: true },
    { no: 98, name: "unpacked_sfixed64", kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, repeated: true },
    { no: 99, name: "unpacked_float", kind: "scalar", T: 2 /* ScalarType.FLOAT */, repeated: true },
    { no: 100, name: "unpacked_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, repeated: true },
    { no: 101, name: "unpacked_bool", kind: "scalar", T: 8 /* ScalarType.BOOL */, repeated: true },
    { no: 102, name: "unpacked_nested_enum", kind: "enum", T: proto2.getEnumType(TestAllTypesProto2_NestedEnum), repeated: true },
    { no: 56, name: "map_int32_int32", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} },
    { no: 57, name: "map_int64_int64", kind: "map", K: 3 /* ScalarType.INT64 */, V: {kind: "scalar", T: 3 /* ScalarType.INT64 */} },
    { no: 58, name: "map_uint32_uint32", kind: "map", K: 13 /* ScalarType.UINT32 */, V: {kind: "scalar", T: 13 /* ScalarType.UINT32 */} },
    { no: 59, name: "map_uint64_uint64", kind: "map", K: 4 /* ScalarType.UINT64 */, V: {kind: "scalar", T: 4 /* ScalarType.UINT64 */} },
    { no: 60, name: "map_sint32_sint32", kind: "map", K: 17 /* ScalarType.SINT32 */, V: {kind: "scalar", T: 17 /* ScalarType.SINT32 */} },
    { no: 61, name: "map_sint64_sint64", kind: "map", K: 18 /* ScalarType.SINT64 */, V: {kind: "scalar", T: 18 /* ScalarType.SINT64 */} },
    { no: 62, name: "map_fixed32_fixed32", kind: "map", K: 7 /* ScalarType.FIXED32 */, V: {kind: "scalar", T: 7 /* ScalarType.FIXED32 */} },
    { no: 63, name: "map_fixed64_fixed64", kind: "map", K: 6 /* ScalarType.FIXED64 */, V: {kind: "scalar", T: 6 /* ScalarType.FIXED64 */} },
    { no: 64, name: "map_sfixed32_sfixed32", kind: "map", K: 15 /* ScalarType.SFIXED32 */, V: {kind: "scalar", T: 15 /* ScalarType.SFIXED32 */} },
    { no: 65, name: "map_sfixed64_sfixed64", kind: "map", K: 16 /* ScalarType.SFIXED64 */, V: {kind: "scalar", T: 16 /* ScalarType.SFIXED64 */} },
    { no: 66, name: "map_int32_float", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 2 /* ScalarType.FLOAT */} },
    { no: 67, name: "map_int32_double", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 1 /* ScalarType.DOUBLE */} },
    { no: 68, name: "map_bool_bool", kind: "map", K: 8 /* ScalarType.BOOL */, V: {kind: "scalar", T: 8 /* ScalarType.BOOL */} },
    { no: 69, name: "map_string_string", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} },
    { no: 70, name: "map_string_bytes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 12 /* ScalarType.BYTES */} },
    { no: 71, name: "map_string_nested_message", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: TestAllTypesProto2_NestedMessage} },
    { no: 72, name: "map_string_foreign_message", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: ForeignMessageProto2} },
    { no: 73, name: "map_string_nested_enum", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "enum", T: proto2.getEnumType(TestAllTypesProto2_NestedEnum)} },
    { no: 74, name: "map_string_foreign_enum", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "enum", T: proto2.getEnumType(ForeignEnumProto2)} },
    { no: 111, name: "oneof_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, oneof: "oneof_field" },
    { no: 112, name: "oneof_nested_message", kind: "message", T: TestAllTypesProto2_NestedMessage, oneof: "oneof_field" },
    { no: 113, name: "oneof_string", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "oneof_field" },
    { no: 114, name: "oneof_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, oneof: "oneof_field" },
    { no: 115, name: "oneof_bool", kind: "scalar", T: 8 /* ScalarType.BOOL */, oneof: "oneof_field" },
    { no: 116, name: "oneof_uint64", kind: "scalar", T: 4 /* ScalarType.UINT64 */, oneof: "oneof_field" },
    { no: 117, name: "oneof_float", kind: "scalar", T: 2 /* ScalarType.FLOAT */, oneof: "oneof_field" },
    { no: 118, name: "oneof_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, oneof: "oneof_field" },
    { no: 119, name: "oneof_enum", kind: "enum", T: proto2.getEnumType(TestAllTypesProto2_NestedEnum), oneof: "oneof_field" },
    { no: 201, name: "data", kind: "message", T: TestAllTypesProto2_Data, opt: true },
    { no: 241, name: "default_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true, default: -123456789 },
    { no: 242, name: "default_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true, default: protoInt64.parse("-9123456789123456789") },
    { no: 243, name: "default_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true, default: 2123456789 },
    { no: 244, name: "default_uint64", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true, default: protoInt64.uParse("10123456789123456789") },
    { no: 245, name: "default_sint32", kind: "scalar", T: 17 /* ScalarType.SINT32 */, opt: true, default: -123456789 },
    { no: 246, name: "default_sint64", kind: "scalar", T: 18 /* ScalarType.SINT64 */, opt: true, default: protoInt64.parse("-9123456789123456789") },
    { no: 247, name: "default_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, opt: true, default: 2123456789 },
    { no: 248, name: "default_fixed64", kind: "scalar", T: 6 /* ScalarType.FIXED64 */, opt: true, default: protoInt64.uParse("10123456789123456789") },
    { no: 249, name: "default_sfixed32", kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, opt: true, default: -123456789 },
    { no: 250, name: "default_sfixed64", kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, opt: true, default: protoInt64.parse("-9123456789123456789") },
    { no: 251, name: "default_float", kind: "scalar", T: 2 /* ScalarType.FLOAT */, opt: true, default: 9000000000 },
    { no: 252, name: "default_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, opt: true, default: 7e+22 },
    { no: 253, name: "default_bool", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: true },
    { no: 254, name: "default_string", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true, default: "Rosebud" },
    { no: 255, name: "default_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true, default: new Uint8Array([0x6A, 0x6F, 0x73, 0x68, 0x75, 0x61]) },
    { no: 401, name: "fieldname1", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 402, name: "field_name2", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 403, name: "_field_name3", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 404, name: "field__name4_", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 405, name: "field0name5", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 406, name: "field_0_name6", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 407, name: "fieldName7", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 408, name: "FieldName8", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 409, name: "field_Name9", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 410, name: "Field_Name10", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 411, name: "FIELD_NAME11", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 412, name: "FIELD_name12", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 413, name: "__field_name13", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 414, name: "__Field_name14", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 415, name: "field__name15", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 416, name: "field__Name16", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 417, name: "field_name17__", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 418, name: "Field_name18__", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TestAllTypesProto2 {
    return new TestAllTypesProto2().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TestAllTypesProto2 {
    return new TestAllTypesProto2().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TestAllTypesProto2 {
    return new TestAllTypesProto2().fromJsonString(jsonString, options);
  }

  static equals(a: TestAllTypesProto2 | PlainMessage<TestAllTypesProto2> | undefined, b: TestAllTypesProto2 | PlainMessage<TestAllTypesProto2> | undefined): boolean {
    return proto2.util.equals(TestAllTypesProto2, a, b);
  }
}

/**
 * @generated from enum protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum
 */
export enum TestAllTypesProto2_NestedEnum {
  /**
   * @generated from enum value: FOO = 0;
   */
  FOO = 0,

  /**
   * @generated from enum value: BAR = 1;
   */
  BAR = 1,

  /**
   * @generated from enum value: BAZ = 2;
   */
  BAZ = 2,

  /**
   * Intentionally negative.
   *
   * @generated from enum value: NEG = -1;
   */
  NEG = -1,
}
// Retrieve enum metadata with: proto2.getEnumType(TestAllTypesProto2_NestedEnum)
proto2.util.setEnumType(TestAllTypesProto2_NestedEnum, "protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum", [
  { no: 0, name: "FOO" },
  { no: 1, name: "BAR" },
  { no: 2, name: "BAZ" },
  { no: -1, name: "NEG" },
]);

/**
 * @generated from message protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage
 */
export class TestAllTypesProto2_NestedMessage extends Message<TestAllTypesProto2_NestedMessage> {
  /**
   * @generated from field: optional int32 a = 1;
   */
  a?: number;

  /**
   * @generated from field: optional protobuf_test_messages.proto2.TestAllTypesProto2 corecursive = 2;
   */
  corecursive?: TestAllTypesProto2;

  constructor(data?: PartialMessage<TestAllTypesProto2_NestedMessage>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 1, name: "a", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 2, name: "corecursive", kind: "message", T: TestAllTypesProto2, opt: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TestAllTypesProto2_NestedMessage {
    return new TestAllTypesProto2_NestedMessage().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TestAllTypesProto2_NestedMessage {
    return new TestAllTypesProto2_NestedMessage().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TestAllTypesProto2_NestedMessage {
    return new TestAllTypesProto2_NestedMessage().fromJsonString(jsonString, options);
  }

  static equals(a: TestAllTypesProto2_NestedMessage | PlainMessage<TestAllTypesProto2_NestedMessage> | undefined, b: TestAllTypesProto2_NestedMessage | PlainMessage<TestAllTypesProto2_NestedMessage> | undefined): boolean {
    return proto2.util.equals(TestAllTypesProto2_NestedMessage, a, b);
  }
}

/**
 * groups
 *
 * @generated from message protobuf_test_messages.proto2.TestAllTypesProto2.Data
 */
export class TestAllTypesProto2_Data extends Message<TestAllTypesProto2_Data> {
  /**
   * @generated from field: optional int32 group_int32 = 202;
   */
  groupInt32?: number;

  /**
   * @generated from field: optional uint32 group_uint32 = 203;
   */
  groupUint32?: number;

  constructor(data?: PartialMessage<TestAllTypesProto2_Data>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.TestAllTypesProto2.Data";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 202, name: "group_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 203, name: "group_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TestAllTypesProto2_Data {
    return new TestAllTypesProto2_Data().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TestAllTypesProto2_Data {
    return new TestAllTypesProto2_Data().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TestAllTypesProto2_Data {
    return new TestAllTypesProto2_Data().fromJsonString(jsonString, options);
  }

  static equals(a: TestAllTypesProto2_Data | PlainMessage<TestAllTypesProto2_Data> | undefined, b: TestAllTypesProto2_Data | PlainMessage<TestAllTypesProto2_Data> | undefined): boolean {
    return proto2.util.equals(TestAllTypesProto2_Data, a, b);
  }
}

/**
 * message_set test case.
 *
 * @generated from message protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrect
 */
export class TestAllTypesProto2_MessageSetCorrect extends Message<TestAllTypesProto2_MessageSetCorrect> {
  constructor(data?: PartialMessage<TestAllTypesProto2_MessageSetCorrect>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrect";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TestAllTypesProto2_MessageSetCorrect {
    return new TestAllTypesProto2_MessageSetCorrect().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TestAllTypesProto2_MessageSetCorrect {
    return new TestAllTypesProto2_MessageSetCorrect().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TestAllTypesProto2_MessageSetCorrect {
    return new TestAllTypesProto2_MessageSetCorrect().fromJsonString(jsonString, options);
  }

  static equals(a: TestAllTypesProto2_MessageSetCorrect | PlainMessage<TestAllTypesProto2_MessageSetCorrect> | undefined, b: TestAllTypesProto2_MessageSetCorrect | PlainMessage<TestAllTypesProto2_MessageSetCorrect> | undefined): boolean {
    return proto2.util.equals(TestAllTypesProto2_MessageSetCorrect, a, b);
  }
}

/**
 * @generated from message protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension1
 */
export class TestAllTypesProto2_MessageSetCorrectExtension1 extends Message<TestAllTypesProto2_MessageSetCorrectExtension1> {
  /**
   * @generated from field: optional string str = 25;
   */
  str?: string;

  constructor(data?: PartialMessage<TestAllTypesProto2_MessageSetCorrectExtension1>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension1";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 25, name: "str", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TestAllTypesProto2_MessageSetCorrectExtension1 {
    return new TestAllTypesProto2_MessageSetCorrectExtension1().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TestAllTypesProto2_MessageSetCorrectExtension1 {
    return new TestAllTypesProto2_MessageSetCorrectExtension1().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TestAllTypesProto2_MessageSetCorrectExtension1 {
    return new TestAllTypesProto2_MessageSetCorrectExtension1().fromJsonString(jsonString, options);
  }

  static equals(a: TestAllTypesProto2_MessageSetCorrectExtension1 | PlainMessage<TestAllTypesProto2_MessageSetCorrectExtension1> | undefined, b: TestAllTypesProto2_MessageSetCorrectExtension1 | PlainMessage<TestAllTypesProto2_MessageSetCorrectExtension1> | undefined): boolean {
    return proto2.util.equals(TestAllTypesProto2_MessageSetCorrectExtension1, a, b);
  }
}

/**
 * @generated from message protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension2
 */
export class TestAllTypesProto2_MessageSetCorrectExtension2 extends Message<TestAllTypesProto2_MessageSetCorrectExtension2> {
  /**
   * @generated from field: optional int32 i = 9;
   */
  i?: number;

  constructor(data?: PartialMessage<TestAllTypesProto2_MessageSetCorrectExtension2>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension2";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 9, name: "i", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TestAllTypesProto2_MessageSetCorrectExtension2 {
    return new TestAllTypesProto2_MessageSetCorrectExtension2().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TestAllTypesProto2_MessageSetCorrectExtension2 {
    return new TestAllTypesProto2_MessageSetCorrectExtension2().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TestAllTypesProto2_MessageSetCorrectExtension2 {
    return new TestAllTypesProto2_MessageSetCorrectExtension2().fromJsonString(jsonString, options);
  }

  static equals(a: TestAllTypesProto2_MessageSetCorrectExtension2 | PlainMessage<TestAllTypesProto2_MessageSetCorrectExtension2> | undefined, b: TestAllTypesProto2_MessageSetCorrectExtension2 | PlainMessage<TestAllTypesProto2_MessageSetCorrectExtension2> | undefined): boolean {
    return proto2.util.equals(TestAllTypesProto2_MessageSetCorrectExtension2, a, b);
  }
}

/**
 * @generated from message protobuf_test_messages.proto2.ForeignMessageProto2
 */
export class ForeignMessageProto2 extends Message<ForeignMessageProto2> {
  /**
   * @generated from field: optional int32 c = 1;
   */
  c?: number;

  constructor(data?: PartialMessage<ForeignMessageProto2>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.ForeignMessageProto2";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 1, name: "c", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ForeignMessageProto2 {
    return new ForeignMessageProto2().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ForeignMessageProto2 {
    return new ForeignMessageProto2().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ForeignMessageProto2 {
    return new ForeignMessageProto2().fromJsonString(jsonString, options);
  }

  static equals(a: ForeignMessageProto2 | PlainMessage<ForeignMessageProto2> | undefined, b: ForeignMessageProto2 | PlainMessage<ForeignMessageProto2> | undefined): boolean {
    return proto2.util.equals(ForeignMessageProto2, a, b);
  }
}

/**
 * @generated from message protobuf_test_messages.proto2.UnknownToTestAllTypes
 */
export class UnknownToTestAllTypes extends Message<UnknownToTestAllTypes> {
  /**
   * @generated from field: optional int32 optional_int32 = 1001;
   */
  optionalInt32?: number;

  /**
   * @generated from field: optional string optional_string = 1002;
   */
  optionalString?: string;

  /**
   * @generated from field: optional protobuf_test_messages.proto2.ForeignMessageProto2 nested_message = 1003;
   */
  nestedMessage?: ForeignMessageProto2;

  /**
   * @generated from field: optional protobuf_test_messages.proto2.UnknownToTestAllTypes.OptionalGroup optionalgroup = 1004;
   */
  optionalgroup?: UnknownToTestAllTypes_OptionalGroup;

  /**
   * @generated from field: optional bool optional_bool = 1006;
   */
  optionalBool?: boolean;

  /**
   * @generated from field: repeated int32 repeated_int32 = 1011;
   */
  repeatedInt32: number[] = [];

  constructor(data?: PartialMessage<UnknownToTestAllTypes>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.UnknownToTestAllTypes";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 1001, name: "optional_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 1002, name: "optional_string", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
    { no: 1003, name: "nested_message", kind: "message", T: ForeignMessageProto2, opt: true },
    { no: 1004, name: "optionalgroup", kind: "message", T: UnknownToTestAllTypes_OptionalGroup, opt: true },
    { no: 1006, name: "optional_bool", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
    { no: 1011, name: "repeated_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): UnknownToTestAllTypes {
    return new UnknownToTestAllTypes().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): UnknownToTestAllTypes {
    return new UnknownToTestAllTypes().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): UnknownToTestAllTypes {
    return new UnknownToTestAllTypes().fromJsonString(jsonString, options);
  }

  static equals(a: UnknownToTestAllTypes | PlainMessage<UnknownToTestAllTypes> | undefined, b: UnknownToTestAllTypes | PlainMessage<UnknownToTestAllTypes> | undefined): boolean {
    return proto2.util.equals(UnknownToTestAllTypes, a, b);
  }
}

/**
 * @generated from message protobuf_test_messages.proto2.UnknownToTestAllTypes.OptionalGroup
 */
export class UnknownToTestAllTypes_OptionalGroup extends Message<UnknownToTestAllTypes_OptionalGroup> {
  /**
   * @generated from field: optional int32 a = 1;
   */
  a?: number;

  constructor(data?: PartialMessage<UnknownToTestAllTypes_OptionalGroup>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.UnknownToTestAllTypes.OptionalGroup";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 1, name: "a", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): UnknownToTestAllTypes_OptionalGroup {
    return new UnknownToTestAllTypes_OptionalGroup().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): UnknownToTestAllTypes_OptionalGroup {
    return new UnknownToTestAllTypes_OptionalGroup().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): UnknownToTestAllTypes_OptionalGroup {
    return new UnknownToTestAllTypes_OptionalGroup().fromJsonString(jsonString, options);
  }

  static equals(a: UnknownToTestAllTypes_OptionalGroup | PlainMessage<UnknownToTestAllTypes_OptionalGroup> | undefined, b: UnknownToTestAllTypes_OptionalGroup | PlainMessage<UnknownToTestAllTypes_OptionalGroup> | undefined): boolean {
    return proto2.util.equals(UnknownToTestAllTypes_OptionalGroup, a, b);
  }
}

/**
 * @generated from message protobuf_test_messages.proto2.NullHypothesisProto2
 */
export class NullHypothesisProto2 extends Message<NullHypothesisProto2> {
  constructor(data?: PartialMessage<NullHypothesisProto2>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.NullHypothesisProto2";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): NullHypothesisProto2 {
    return new NullHypothesisProto2().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): NullHypothesisProto2 {
    return new NullHypothesisProto2().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): NullHypothesisProto2 {
    return new NullHypothesisProto2().fromJsonString(jsonString, options);
  }

  static equals(a: NullHypothesisProto2 | PlainMessage<NullHypothesisProto2> | undefined, b: NullHypothesisProto2 | PlainMessage<NullHypothesisProto2> | undefined): boolean {
    return proto2.util.equals(NullHypothesisProto2, a, b);
  }
}

/**
 * @generated from message protobuf_test_messages.proto2.EnumOnlyProto2
 */
export class EnumOnlyProto2 extends Message<EnumOnlyProto2> {
  constructor(data?: PartialMessage<EnumOnlyProto2>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.EnumOnlyProto2";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): EnumOnlyProto2 {
    return new EnumOnlyProto2().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): EnumOnlyProto2 {
    return new EnumOnlyProto2().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): EnumOnlyProto2 {
    return new EnumOnlyProto2().fromJsonString(jsonString, options);
  }

  static equals(a: EnumOnlyProto2 | PlainMessage<EnumOnlyProto2> | undefined, b: EnumOnlyProto2 | PlainMessage<EnumOnlyProto2> | undefined): boolean {
    return proto2.util.equals(EnumOnlyProto2, a, b);
  }
}

/**
 * @generated from enum protobuf_test_messages.proto2.EnumOnlyProto2.Bool
 */
export enum EnumOnlyProto2_Bool {
  /**
   * @generated from enum value: kFalse = 0;
   */
  kFalse = 0,

  /**
   * @generated from enum value: kTrue = 1;
   */
  kTrue = 1,
}
// Retrieve enum metadata with: proto2.getEnumType(EnumOnlyProto2_Bool)
proto2.util.setEnumType(EnumOnlyProto2_Bool, "protobuf_test_messages.proto2.EnumOnlyProto2.Bool", [
  { no: 0, name: "kFalse" },
  { no: 1, name: "kTrue" },
]);

/**
 * @generated from message protobuf_test_messages.proto2.OneStringProto2
 */
export class OneStringProto2 extends Message<OneStringProto2> {
  /**
   * @generated from field: optional string data = 1;
   */
  data?: string;

  constructor(data?: PartialMessage<OneStringProto2>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.OneStringProto2";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 1, name: "data", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): OneStringProto2 {
    return new OneStringProto2().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): OneStringProto2 {
    return new OneStringProto2().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): OneStringProto2 {
    return new OneStringProto2().fromJsonString(jsonString, options);
  }

  static equals(a: OneStringProto2 | PlainMessage<OneStringProto2> | undefined, b: OneStringProto2 | PlainMessage<OneStringProto2> | undefined): boolean {
    return proto2.util.equals(OneStringProto2, a, b);
  }
}

/**
 * @generated from message protobuf_test_messages.proto2.ProtoWithKeywords
 */
export class ProtoWithKeywords extends Message<ProtoWithKeywords> {
  /**
   * @generated from field: optional int32 inline = 1;
   */
  inline?: number;

  /**
   * @generated from field: optional string concept = 2;
   */
  concept?: string;

  /**
   * @generated from field: repeated string requires = 3;
   */
  requires: string[] = [];

  constructor(data?: PartialMessage<ProtoWithKeywords>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.ProtoWithKeywords";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 1, name: "inline", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
    { no: 2, name: "concept", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
    { no: 3, name: "requires", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ProtoWithKeywords {
    return new ProtoWithKeywords().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ProtoWithKeywords {
    return new ProtoWithKeywords().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ProtoWithKeywords {
    return new ProtoWithKeywords().fromJsonString(jsonString, options);
  }

  static equals(a: ProtoWithKeywords | PlainMessage<ProtoWithKeywords> | undefined, b: ProtoWithKeywords | PlainMessage<ProtoWithKeywords> | undefined): boolean {
    return proto2.util.equals(ProtoWithKeywords, a, b);
  }
}

/**
 * @generated from message protobuf_test_messages.proto2.TestAllRequiredTypesProto2
 */
export class TestAllRequiredTypesProto2 extends Message<TestAllRequiredTypesProto2> {
  /**
   * Singular
   *
   * @generated from field: required int32 required_int32 = 1;
   */
  requiredInt32?: number;

  /**
   * @generated from field: required int64 required_int64 = 2;
   */
  requiredInt64?: bigint;

  /**
   * @generated from field: required uint32 required_uint32 = 3;
   */
  requiredUint32?: number;

  /**
   * @generated from field: required uint64 required_uint64 = 4;
   */
  requiredUint64?: bigint;

  /**
   * @generated from field: required sint32 required_sint32 = 5;
   */
  requiredSint32?: number;

  /**
   * @generated from field: required sint64 required_sint64 = 6;
   */
  requiredSint64?: bigint;

  /**
   * @generated from field: required fixed32 required_fixed32 = 7;
   */
  requiredFixed32?: number;

  /**
   * @generated from field: required fixed64 required_fixed64 = 8;
   */
  requiredFixed64?: bigint;

  /**
   * @generated from field: required sfixed32 required_sfixed32 = 9;
   */
  requiredSfixed32?: number;

  /**
   * @generated from field: required sfixed64 required_sfixed64 = 10;
   */
  requiredSfixed64?: bigint;

  /**
   * @generated from field: required float required_float = 11;
   */
  requiredFloat?: number;

  /**
   * @generated from field: required double required_double = 12;
   */
  requiredDouble?: number;

  /**
   * @generated from field: required bool required_bool = 13;
   */
  requiredBool?: boolean;

  /**
   * @generated from field: required string required_string = 14;
   */
  requiredString?: string;

  /**
   * @generated from field: required bytes required_bytes = 15;
   */
  requiredBytes?: Uint8Array;

  /**
   * @generated from field: required protobuf_test_messages.proto2.TestAllRequiredTypesProto2.NestedMessage required_nested_message = 18;
   */
  requiredNestedMessage?: TestAllRequiredTypesProto2_NestedMessage;

  /**
   * @generated from field: required protobuf_test_messages.proto2.ForeignMessageProto2 required_foreign_message = 19;
   */
  requiredForeignMessage?: ForeignMessageProto2;

  /**
   * @generated from field: required protobuf_test_messages.proto2.TestAllRequiredTypesProto2.NestedEnum required_nested_enum = 21;
   */
  requiredNestedEnum?: TestAllRequiredTypesProto2_NestedEnum;

  /**
   * @generated from field: required protobuf_test_messages.proto2.ForeignEnumProto2 required_foreign_enum = 22;
   */
  requiredForeignEnum?: ForeignEnumProto2;

  /**
   * @generated from field: required string required_string_piece = 24;
   */
  requiredStringPiece?: string;

  /**
   * @generated from field: required string required_cord = 25;
   */
  requiredCord?: string;

  /**
   * @generated from field: required protobuf_test_messages.proto2.TestAllRequiredTypesProto2 recursive_message = 27;
   */
  recursiveMessage?: TestAllRequiredTypesProto2;

  /**
   * @generated from field: optional protobuf_test_messages.proto2.TestAllRequiredTypesProto2 optional_recursive_message = 28;
   */
  optionalRecursiveMessage?: TestAllRequiredTypesProto2;

  /**
   * @generated from field: required protobuf_test_messages.proto2.TestAllRequiredTypesProto2.Data data = 201;
   */
  data?: TestAllRequiredTypesProto2_Data;

  /**
   * default values
   *
   * @generated from field: required int32 default_int32 = 241 [default = -123456789];
   */
  defaultInt32?: number;

  /**
   * @generated from field: required int64 default_int64 = 242 [default = -9123456789123456789];
   */
  defaultInt64?: bigint;

  /**
   * @generated from field: required uint32 default_uint32 = 243 [default = 2123456789];
   */
  defaultUint32?: number;

  /**
   * @generated from field: required uint64 default_uint64 = 244 [default = 10123456789123456789];
   */
  defaultUint64?: bigint;

  /**
   * @generated from field: required sint32 default_sint32 = 245 [default = -123456789];
   */
  defaultSint32?: number;

  /**
   * @generated from field: required sint64 default_sint64 = 246 [default = -9123456789123456789];
   */
  defaultSint64?: bigint;

  /**
   * @generated from field: required fixed32 default_fixed32 = 247 [default = 2123456789];
   */
  defaultFixed32?: number;

  /**
   * @generated from field: required fixed64 default_fixed64 = 248 [default = 10123456789123456789];
   */
  defaultFixed64?: bigint;

  /**
   * @generated from field: required sfixed32 default_sfixed32 = 249 [default = -123456789];
   */
  defaultSfixed32?: number;

  /**
   * @generated from field: required sfixed64 default_sfixed64 = 250 [default = -9123456789123456789];
   */
  defaultSfixed64?: bigint;

  /**
   * @generated from field: required float default_float = 251 [default = 9e+09];
   */
  defaultFloat?: number;

  /**
   * @generated from field: required double default_double = 252 [default = 7e+22];
   */
  defaultDouble?: number;

  /**
   * @generated from field: required bool default_bool = 253 [default = true];
   */
  defaultBool?: boolean;

  /**
   * @generated from field: required string default_string = 254 [default = "Rosebud"];
   */
  defaultString?: string;

  /**
   * @generated from field: required bytes default_bytes = 255 [default = "joshua"];
   */
  defaultBytes?: Uint8Array;

  constructor(data?: PartialMessage<TestAllRequiredTypesProto2>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.TestAllRequiredTypesProto2";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 1, name: "required_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
    { no: 2, name: "required_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
    { no: 3, name: "required_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
    { no: 4, name: "required_uint64", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
    { no: 5, name: "required_sint32", kind: "scalar", T: 17 /* ScalarType.SINT32 */ },
    { no: 6, name: "required_sint64", kind: "scalar", T: 18 /* ScalarType.SINT64 */ },
    { no: 7, name: "required_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */ },
    { no: 8, name: "required_fixed64", kind: "scalar", T: 6 /* ScalarType.FIXED64 */ },
    { no: 9, name: "required_sfixed32", kind: "scalar", T: 15 /* ScalarType.SFIXED32 */ },
    { no: 10, name: "required_sfixed64", kind: "scalar", T: 16 /* ScalarType.SFIXED64 */ },
    { no: 11, name: "required_float", kind: "scalar", T: 2 /* ScalarType.FLOAT */ },
    { no: 12, name: "required_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ },
    { no: 13, name: "required_bool", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
    { no: 14, name: "required_string", kind: "scalar", T: 9 /* ScalarType.STRING */ },
    { no: 15, name: "required_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
    { no: 18, name: "required_nested_message", kind: "message", T: TestAllRequiredTypesProto2_NestedMessage },
    { no: 19, name: "required_foreign_message", kind: "message", T: ForeignMessageProto2 },
    { no: 21, name: "required_nested_enum", kind: "enum", T: proto2.getEnumType(TestAllRequiredTypesProto2_NestedEnum) },
    { no: 22, name: "required_foreign_enum", kind: "enum", T: proto2.getEnumType(ForeignEnumProto2) },
    { no: 24, name: "required_string_piece", kind: "scalar", T: 9 /* ScalarType.STRING */ },
    { no: 25, name: "required_cord", kind: "scalar", T: 9 /* ScalarType.STRING */ },
    { no: 27, name: "recursive_message", kind: "message", T: TestAllRequiredTypesProto2 },
    { no: 28, name: "optional_recursive_message", kind: "message", T: TestAllRequiredTypesProto2, opt: true },
    { no: 201, name: "data", kind: "message", T: TestAllRequiredTypesProto2_Data },
    { no: 241, name: "default_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, default: -123456789 },
    { no: 242, name: "default_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */, default: protoInt64.parse("-9123456789123456789") },
    { no: 243, name: "default_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, default: 2123456789 },
    { no: 244, name: "default_uint64", kind: "scalar", T: 4 /* ScalarType.UINT64 */, default: protoInt64.uParse("10123456789123456789") },
    { no: 245, name: "default_sint32", kind: "scalar", T: 17 /* ScalarType.SINT32 */, default: -123456789 },
    { no: 246, name: "default_sint64", kind: "scalar", T: 18 /* ScalarType.SINT64 */, default: protoInt64.parse("-9123456789123456789") },
    { no: 247, name: "default_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, default: 2123456789 },
    { no: 248, name: "default_fixed64", kind: "scalar", T: 6 /* ScalarType.FIXED64 */, default: protoInt64.uParse("10123456789123456789") },
    { no: 249, name: "default_sfixed32", kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, default: -123456789 },
    { no: 250, name: "default_sfixed64", kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, default: protoInt64.parse("-9123456789123456789") },
    { no: 251, name: "default_float", kind: "scalar", T: 2 /* ScalarType.FLOAT */, default: 9000000000 },
    { no: 252, name: "default_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, default: 7e+22 },
    { no: 253, name: "default_bool", kind: "scalar", T: 8 /* ScalarType.BOOL */, default: true },
    { no: 254, name: "default_string", kind: "scalar", T: 9 /* ScalarType.STRING */, default: "Rosebud" },
    { no: 255, name: "default_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, default: new Uint8Array([0x6A, 0x6F, 0x73, 0x68, 0x75, 0x61]) },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TestAllRequiredTypesProto2 {
    return new TestAllRequiredTypesProto2().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TestAllRequiredTypesProto2 {
    return new TestAllRequiredTypesProto2().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TestAllRequiredTypesProto2 {
    return new TestAllRequiredTypesProto2().fromJsonString(jsonString, options);
  }

  static equals(a: TestAllRequiredTypesProto2 | PlainMessage<TestAllRequiredTypesProto2> | undefined, b: TestAllRequiredTypesProto2 | PlainMessage<TestAllRequiredTypesProto2> | undefined): boolean {
    return proto2.util.equals(TestAllRequiredTypesProto2, a, b);
  }
}

/**
 * @generated from enum protobuf_test_messages.proto2.TestAllRequiredTypesProto2.NestedEnum
 */
export enum TestAllRequiredTypesProto2_NestedEnum {
  /**
   * @generated from enum value: FOO = 0;
   */
  FOO = 0,

  /**
   * @generated from enum value: BAR = 1;
   */
  BAR = 1,

  /**
   * @generated from enum value: BAZ = 2;
   */
  BAZ = 2,

  /**
   * Intentionally negative.
   *
   * @generated from enum value: NEG = -1;
   */
  NEG = -1,
}
// Retrieve enum metadata with: proto2.getEnumType(TestAllRequiredTypesProto2_NestedEnum)
proto2.util.setEnumType(TestAllRequiredTypesProto2_NestedEnum, "protobuf_test_messages.proto2.TestAllRequiredTypesProto2.NestedEnum", [
  { no: 0, name: "FOO" },
  { no: 1, name: "BAR" },
  { no: 2, name: "BAZ" },
  { no: -1, name: "NEG" },
]);

/**
 * @generated from message protobuf_test_messages.proto2.TestAllRequiredTypesProto2.NestedMessage
 */
export class TestAllRequiredTypesProto2_NestedMessage extends Message<TestAllRequiredTypesProto2_NestedMessage> {
  /**
   * @generated from field: required int32 a = 1;
   */
  a?: number;

  /**
   * @generated from field: required protobuf_test_messages.proto2.TestAllRequiredTypesProto2 corecursive = 2;
   */
  corecursive?: TestAllRequiredTypesProto2;

  /**
   * @generated from field: optional protobuf_test_messages.proto2.TestAllRequiredTypesProto2 optional_corecursive = 3;
   */
  optionalCorecursive?: TestAllRequiredTypesProto2;

  constructor(data?: PartialMessage<TestAllRequiredTypesProto2_NestedMessage>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.TestAllRequiredTypesProto2.NestedMessage";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 1, name: "a", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
    { no: 2, name: "corecursive", kind: "message", T: TestAllRequiredTypesProto2 },
    { no: 3, name: "optional_corecursive", kind: "message", T: TestAllRequiredTypesProto2, opt: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TestAllRequiredTypesProto2_NestedMessage {
    return new TestAllRequiredTypesProto2_NestedMessage().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TestAllRequiredTypesProto2_NestedMessage {
    return new TestAllRequiredTypesProto2_NestedMessage().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TestAllRequiredTypesProto2_NestedMessage {
    return new TestAllRequiredTypesProto2_NestedMessage().fromJsonString(jsonString, options);
  }

  static equals(a: TestAllRequiredTypesProto2_NestedMessage | PlainMessage<TestAllRequiredTypesProto2_NestedMessage> | undefined, b: TestAllRequiredTypesProto2_NestedMessage | PlainMessage<TestAllRequiredTypesProto2_NestedMessage> | undefined): boolean {
    return proto2.util.equals(TestAllRequiredTypesProto2_NestedMessage, a, b);
  }
}

/**
 * groups
 *
 * @generated from message protobuf_test_messages.proto2.TestAllRequiredTypesProto2.Data
 */
export class TestAllRequiredTypesProto2_Data extends Message<TestAllRequiredTypesProto2_Data> {
  /**
   * @generated from field: required int32 group_int32 = 202;
   */
  groupInt32?: number;

  /**
   * @generated from field: required uint32 group_uint32 = 203;
   */
  groupUint32?: number;

  constructor(data?: PartialMessage<TestAllRequiredTypesProto2_Data>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.TestAllRequiredTypesProto2.Data";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 202, name: "group_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
    { no: 203, name: "group_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TestAllRequiredTypesProto2_Data {
    return new TestAllRequiredTypesProto2_Data().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TestAllRequiredTypesProto2_Data {
    return new TestAllRequiredTypesProto2_Data().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TestAllRequiredTypesProto2_Data {
    return new TestAllRequiredTypesProto2_Data().fromJsonString(jsonString, options);
  }

  static equals(a: TestAllRequiredTypesProto2_Data | PlainMessage<TestAllRequiredTypesProto2_Data> | undefined, b: TestAllRequiredTypesProto2_Data | PlainMessage<TestAllRequiredTypesProto2_Data> | undefined): boolean {
    return proto2.util.equals(TestAllRequiredTypesProto2_Data, a, b);
  }
}

/**
 * message_set test case.
 *
 * @generated from message protobuf_test_messages.proto2.TestAllRequiredTypesProto2.MessageSetCorrect
 */
export class TestAllRequiredTypesProto2_MessageSetCorrect extends Message<TestAllRequiredTypesProto2_MessageSetCorrect> {
  constructor(data?: PartialMessage<TestAllRequiredTypesProto2_MessageSetCorrect>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.TestAllRequiredTypesProto2.MessageSetCorrect";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TestAllRequiredTypesProto2_MessageSetCorrect {
    return new TestAllRequiredTypesProto2_MessageSetCorrect().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TestAllRequiredTypesProto2_MessageSetCorrect {
    return new TestAllRequiredTypesProto2_MessageSetCorrect().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TestAllRequiredTypesProto2_MessageSetCorrect {
    return new TestAllRequiredTypesProto2_MessageSetCorrect().fromJsonString(jsonString, options);
  }

  static equals(a: TestAllRequiredTypesProto2_MessageSetCorrect | PlainMessage<TestAllRequiredTypesProto2_MessageSetCorrect> | undefined, b: TestAllRequiredTypesProto2_MessageSetCorrect | PlainMessage<TestAllRequiredTypesProto2_MessageSetCorrect> | undefined): boolean {
    return proto2.util.equals(TestAllRequiredTypesProto2_MessageSetCorrect, a, b);
  }
}

/**
 * @generated from message protobuf_test_messages.proto2.TestAllRequiredTypesProto2.MessageSetCorrectExtension1
 */
export class TestAllRequiredTypesProto2_MessageSetCorrectExtension1 extends Message<TestAllRequiredTypesProto2_MessageSetCorrectExtension1> {
  /**
   * @generated from field: required string str = 25;
   */
  str?: string;

  constructor(data?: PartialMessage<TestAllRequiredTypesProto2_MessageSetCorrectExtension1>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.TestAllRequiredTypesProto2.MessageSetCorrectExtension1";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 25, name: "str", kind: "scalar", T: 9 /* ScalarType.STRING */ },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TestAllRequiredTypesProto2_MessageSetCorrectExtension1 {
    return new TestAllRequiredTypesProto2_MessageSetCorrectExtension1().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TestAllRequiredTypesProto2_MessageSetCorrectExtension1 {
    return new TestAllRequiredTypesProto2_MessageSetCorrectExtension1().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TestAllRequiredTypesProto2_MessageSetCorrectExtension1 {
    return new TestAllRequiredTypesProto2_MessageSetCorrectExtension1().fromJsonString(jsonString, options);
  }

  static equals(a: TestAllRequiredTypesProto2_MessageSetCorrectExtension1 | PlainMessage<TestAllRequiredTypesProto2_MessageSetCorrectExtension1> | undefined, b: TestAllRequiredTypesProto2_MessageSetCorrectExtension1 | PlainMessage<TestAllRequiredTypesProto2_MessageSetCorrectExtension1> | undefined): boolean {
    return proto2.util.equals(TestAllRequiredTypesProto2_MessageSetCorrectExtension1, a, b);
  }
}

/**
 * @generated from message protobuf_test_messages.proto2.TestAllRequiredTypesProto2.MessageSetCorrectExtension2
 */
export class TestAllRequiredTypesProto2_MessageSetCorrectExtension2 extends Message<TestAllRequiredTypesProto2_MessageSetCorrectExtension2> {
  /**
   * @generated from field: required int32 i = 9;
   */
  i?: number;

  constructor(data?: PartialMessage<TestAllRequiredTypesProto2_MessageSetCorrectExtension2>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "protobuf_test_messages.proto2.TestAllRequiredTypesProto2.MessageSetCorrectExtension2";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 9, name: "i", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TestAllRequiredTypesProto2_MessageSetCorrectExtension2 {
    return new TestAllRequiredTypesProto2_MessageSetCorrectExtension2().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TestAllRequiredTypesProto2_MessageSetCorrectExtension2 {
    return new TestAllRequiredTypesProto2_MessageSetCorrectExtension2().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TestAllRequiredTypesProto2_MessageSetCorrectExtension2 {
    return new TestAllRequiredTypesProto2_MessageSetCorrectExtension2().fromJsonString(jsonString, options);
  }

  static equals(a: TestAllRequiredTypesProto2_MessageSetCorrectExtension2 | PlainMessage<TestAllRequiredTypesProto2_MessageSetCorrectExtension2> | undefined, b: TestAllRequiredTypesProto2_MessageSetCorrectExtension2 | PlainMessage<TestAllRequiredTypesProto2_MessageSetCorrectExtension2> | undefined): boolean {
    return proto2.util.equals(TestAllRequiredTypesProto2_MessageSetCorrectExtension2, a, b);
  }
}
